E:/E+I/Informatik/Projekte/FH/n-Damen Problem/psolution.c File Reference

#include "ndame.h"

Go to the source code of this file.

Functions

void psolution (struct data *d1)
 psolution


Detailed Description

PURPOSE: file prints solutions on screen

Author:
Daniel Hasemann
Version:
1.0
Date:
December 16th, 2005

Definition in file psolution.c.


Function Documentation

void psolution struct data d1  ) 
 

psolution

This file prints the solutions on screen if singlestep is activated. You can change the queen ascii and the position in the file header "ndame.h".

Parameters:
*d1 is a struct pointer
See also:
calculate()
Author:
Daniel Hasemann
Date:
December 16th, 2005

Definition at line 21 of file psolution.c.

References data::iblength, data::iboard, QUEEN, X_POS, and Y_POS.

00022 {
00023     int ik;
00024     int ii;
00025     
00026     for(ii=0;ii<d1->iblength;ii++)
00027     {
00028         for(ik=0;ik<d1->iblength;ik++)
00029         {                              
00030             gotoxy(X_POS+ik,Y_POS+ii);
00031             if(d1->iboard[ii][ik])
00032             {
00033                 printf("%c",QUEEN);                   //prints solution on screen
00034             }
00035         }
00036     }
00037 }


Generated on Sun Dec 18 19:26:14 2005 for n-Queens Problem by  doxygen 1.4.5